<template>
    <div>
        <component
            :is="getCtl(support)"
            :type="support?control[support].type:''"
            :layout="json"
            :conf="supportConf"
            :paramConfig="paramConfig"
            :portalLayout="portalLayout"
            v-on:dragclick="dragclick"
            :mdl="mdl"
        ></component>
    </div>
</template>

<script>
import ChartDef from './formComponent/ChartDef.vue'
import ListDef from "@/views/modules/form/core/formComponent/ListDef";
import FormDef from "@/views/modules/form/core/formComponent/FormDef";
import TreeDef from "@/views/modules/form/core/formComponent/TreeDef";
import UreportDef from "@/views/modules/form/core/formComponent/UreportDef";
import CustomDef from "@/views/modules/form/core/formComponent/CustomDef";
import CalendarDef from "@/views/modules/form/core/formComponent/CalendarDef";
import TabContainerDef from "@/views/modules/form/core/formComponent/TabContainerDef";
import BpmDef from "@/views/modules/form/core/formComponent/BpmDef";
import CarouselDef from "@/views/modules/form/core/formComponent/CarouselDef";
import layoutTabGrid from "@/views/modules/form/core/formCustomLayout/LayoutTabGrid";
import FilterComponentDef from "@/views/modules/form/core/formComponent/FilterComponentDef";
import ScreenChartDef from "@/views/modules/form/core/formComponent/ScreenChartDef.vue";
import QuickEntranceDef from "@/views/modules/form/core/formComponent/QuickEntranceDef.vue";
import GisMapDef from "@/views/modules/form/core/formComponent/GisMapDef.vue";
import CustomPageDef from "@/views/modules/form/core/formComponent/CustomPageDef.vue";

export default {
    name: "FormCustomEditDef",
    props:["support","json","supportConf","portalLayout","paramConfig","mdl"],
    components:{
        ListDef,
        FormDef,
        TreeDef,
        UreportDef,
        CustomDef,
        CalendarDef,
        TabContainerDef,
        BpmDef,
        CarouselDef,
        ChartDef,
        layoutTabGrid,
        FilterComponentDef,
        ScreenChartDef,
        QuickEntranceDef,
        GisMapDef,
        CustomPageDef
    },
    data(){
        return{
            control:{
                form:{type:'drag',name:FormDef},
                list:{type:'drag',name:ListDef},
                tree:{type:'drag',name:TreeDef},
                tab:{type:'drag',name:layoutTabGrid},
                chart:{type:'chart',name:ChartDef},
                ureport:{type:'ureport',name:UreportDef},
                custom:{type:'custom',name:CustomDef},
                calendar:{type:'calendar',name:CalendarDef},
                filter:{type:'filter',name:FilterComponentDef},
                carousel:{type:'carousel',name:CarouselDef},
                bpm:{type:'bpm',name:BpmDef},
                tabContainer:{type:'drag',name:TabContainerDef},
                screenChart:{type:'drag',name:ScreenChartDef},
                quickEntrance:{type:'quickEntrance',name:QuickEntranceDef},
                gisMap:{type:'gisMap',name:GisMapDef},
                customPage:{type:'customPage',name:CustomPageDef}
            }
        }
    },
    methods:{
        dragclick(config){
            this.$emit('dragclick', config);
        },
        getCtl(support){
            if(!support){return ''}
            return this.control[support].name
        }
    }
}
</script>

<style scoped>

</style>